
package com.yuke.cloud.service.api.opc.service;

import com.yuke.cloud.service.api.opc.dto.gaode.GaodeLocation;
import com.yuke.cloud.service.api.opc.service.hystrix.OpcGaodeFeignApiHystrix;
import com.yuke.cloud.common.security.feign.OAuth2FeignAutoConfiguration;
import com.yuke.cloud.common.util.wrapper.Wrapper;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.Map;

/**
 * The interface Opc gao feign api.
 *
 * @author
 */
@FeignClient(value = "yuke-cloud-service-opc", configuration = OAuth2FeignAutoConfiguration.class,
		fallback = OpcGaodeFeignApiHystrix.class, path = "${yuke.feign-path-opc}")
public interface OpcGaodeFeignApi {

	/**
	 * IP定位.
	 *
	 * @param ipAddr the ip addr
	 *
	 * @return the location by ip addr
	 */
	@PostMapping(value = "/api/auth/getLocationByIpAddr")
	Wrapper<GaodeLocation> getLocationByIpAddr(@RequestParam("ipAddr") String ipAddr);

	/**
	 * 根据地址获取经纬度
	 /** * 根据地址获取经纬度 *
	 *
	 * @param addr 地址，规则遵循：国家、省份、城市、区县、城镇、乡村、街道、门牌号码、屋邨、大厦
	 * @param city 所在城市，可选
	 * @return map: key:addr,value :"116.480656,39.989677",
	 */
	@GetMapping(value = "/api/map/getLonLarByAddress")
	Wrapper<Map> getLonLarByAddr(@RequestParam("addr") String addr, @RequestParam("city") String city);


}
